< previous page page_128 next page >

Page 128
As CurveText considers each segment in the curved path, it creates a font appropriately rotated to lie along the segment. It determines the width of the next character using that font. If there is room to display the character, the subroutine does so. It continues displaying characters on the segment until no more will fit.
When there is not enough room to display another character, the routine adds the next segment to the first. It continues adding segments until their combined length is long enough to hold the next character. At that point, it displays the character. The subroutine continues until it runs out of either path segments or characters to display.
When CurveText moves from one segment to the next, the orientation of the characters changes, too. For that reason, text usually looks best when displayed along a smoothly curving path. If the path makes sudden changes in direction, the text displayed may contain gaps or overlaps.
Because rotated fonts tend to be rougher than original fonts, rotated text also looks better if the font is relatively large and bold.
e10a6a0a59f035e870d90cca05b85fce.gif
Private Sub CurveText(txt As String, numpts As Integer, _
    ptx( ) As Single, pty( ) As Single, above As Boolean, _
    nHeight As Long, nWidth As Long, fnWeight As Long, _
    fbItalic As Long, fbUnderline As Long, _
    fbStrikeOut As Long, fbCharSet As Long, _
    fbOutputPrecision As Long, fbClipPrecision As Long, _
    fbQuality As Long, fbPitchAndFamily As Long, _
    lpszFace As String)
Dim newfont As Long
Dim oldfont As Long
Dim theta As Single
Dim escapement As Long
Dim ch As String
Dim chnum As Integer
Dim needed As Single
Dim avail As Single
Dim newavail As Single
Dim pt As Integer
Dim x1 As Single
Dim y1 As Single
Dim x2 As Single
Dim y2 As Single
Dim dx As Single
Dim dy As Single

    avail = 0
    chnum = 1

    x1 = ptx(1)
    y1 = pty(1)
    For pt = 2 To numpts

 
< previous page page_128 next page >